package com.demo;
/**
 * 有这样一个字符串String s = "  aaaa,bbb,ccc,ddd,  ";
    输出字符串长度
    将字符串两边空格去除
    用逗号做为分隔符，将字符串转成数组{"aaa","bbb","ccc","ddd"}
 * 
 * @author Ericlin
 */
public class Question6 {
	
	// 完全不具备通用性
    public static void main(String[] args) {
        String arr[] = new String[4];
        String s = " aaaa,bbb,ccc,ddd ";
        System.out.println(s.length());
        s = s.substring(1, s.length() - 1);
        System.out.println(s);
        s = s.substring(1, s.length());
        arr = s.split(",");
        for (int i = 0; i < arr.length; i++) {
            System.out.print( arr[i]+"  ");
        }
    }
}
